home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3DRenderer.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  41.0 KB  |  1,293 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DRenderer.a
  3. ;
  4. ;    Contains:    Q3Renderer types and routines                                          
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.1
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3DRENDERER__') = 'UNDEFINED' THEN
  19. __QD3DRENDERER__ SET 1
  20.  
  21.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  22.     include 'QD3D.a'
  23.     ENDIF
  24.     IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
  25.     include 'QD3DSet.a'
  26.     ENDIF
  27.     IF &TYPE('__QD3DVIEW__') = 'UNDEFINED' THEN
  28.     include 'QD3DView.a'
  29.     ENDIF
  30.  
  31.     IF TARGET_OS_MAC THEN
  32.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  33.     include 'Events.a'
  34.     ENDIF
  35.     ENDIF    ; TARGET_OS_MAC
  36. ; ******************************************************************************
  37. ; **                                                                             **
  38. ; **                            User Interface Things                             **
  39. ; **                                                                             **
  40. ; ****************************************************************************
  41.  
  42.     IF TARGET_OS_MAC THEN
  43. ; *  A callback to an application's event handling code. This is needed to    
  44. ; *  support movable modal dialogs. The dialog's event filter calls this      
  45. ; *  callback with events it does not handle.                                 
  46. ; *  If an application handles the event it should return kQ3True.            
  47. ; *  If the application does not handle the event it must return kQ3False and 
  48. ; *  the dialog's event filter will pass the event to the system unhandled.   
  49.  
  50. TQ3DialogAnchor            RECORD 0
  51. clientEventHandler         ds.l    1                ; offset: $0 (0)
  52. sizeof                     EQU *                    ; size:   $4 (4)
  53.                         ENDR
  54.     ELSEIF TARGET_OS_WIN32 THEN
  55. TQ3DialogAnchor            RECORD 0
  56. ownerWindow                 ds.l    1                ; offset: $0 (0)
  57. sizeof                     EQU *                    ; size:   $4 (4)
  58.                         ENDR
  59.     ELSE
  60. TQ3DialogAnchor            RECORD 0
  61. notUsed                     ds.l    1                ; offset: $0 (0)        ;  place holder 
  62. sizeof                     EQU *                    ; size:   $4 (4)
  63.                         ENDR
  64.     ENDIF    ; TARGET_OS_WIN32
  65. ; ******************************************************************************
  66. ; **                                                                             **
  67. ; **                            Renderer Functions                                 **
  68. ; **                                                                             **
  69. ; ****************************************************************************
  70.  
  71. ;
  72. ; extern TQ3RendererObject Q3Renderer_NewFromType(TQ3ObjectType rendererObjectType)
  73. ;
  74.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  75.         IMPORT_CFM_FUNCTION Q3Renderer_NewFromType
  76.     ENDIF
  77.  
  78. ;
  79. ; extern TQ3ObjectType Q3Renderer_GetType(TQ3RendererObject renderer)
  80. ;
  81.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  82.         IMPORT_CFM_FUNCTION Q3Renderer_GetType
  83.     ENDIF
  84.  
  85.  
  86.  
  87. ; *    Non-blocking, flush all buffered graphics to rasterizer. May or
  88. ; *    may not update the draw context.
  89. ; *    
  90. ; *    This function has been replaced by Q3View_Flush
  91.  
  92. ;
  93. ; extern TQ3Status Q3Renderer_Flush(TQ3RendererObject renderer, TQ3ViewObject view)
  94. ;
  95.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  96.         IMPORT_CFM_FUNCTION Q3Renderer_Flush
  97.     ENDIF
  98.  
  99. ; *    Blocking, flush all buffered graphics to rasterizer and update
  100. ; *    draw context.
  101. ; *    
  102. ; *    This function has been replaced by Q3View_Sync
  103.  
  104. ;
  105. ; extern TQ3Status Q3Renderer_Sync(TQ3RendererObject renderer, TQ3ViewObject view)
  106. ;
  107.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  108.         IMPORT_CFM_FUNCTION Q3Renderer_Sync
  109.     ENDIF
  110.  
  111.  
  112.  
  113. ; *    Q3Renderer_IsInteractive
  114. ; *        Determine if this renderer is intended to be used interactively.
  115.  
  116. ;
  117. ; extern TQ3Boolean Q3Renderer_IsInteractive(TQ3RendererObject renderer)
  118. ;
  119.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  120.         IMPORT_CFM_FUNCTION Q3Renderer_IsInteractive
  121.     ENDIF
  122.  
  123.  
  124. ; *    Q3Renderer_HasModalConfigure
  125. ; *        Determine if this renderer has a modal settings dialog.
  126. ; *
  127. ; *    Q3Renderer_ModalConfigure
  128. ; *        Have the renderer pop up a modal dialog box to configure its settings.
  129. ; *    dialogAnchor - is platform specific data passed by the client to support
  130. ; *      movable modal dialogs. 
  131. ; *    MacOS: this is a callback to the calling application's event handler.
  132. ; *      The renderer calls this function with events not handled by the 
  133. ; *      settings dialog. This is necessary in order to support movable modal 
  134. ; *      dialogs. An application's event handler must return kQ3True if it 
  135. ; *      handles the event passed to the callback or kQ3False if not. 
  136. ; *      An application which doesn't want to support a movable modal configure
  137. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  138. ; *    Win32: this is the HWND of the owning window (typically an application's
  139. ; *      main window).
  140. ; *  canceled - returns a boolean inditacating that the user canceled the 
  141. ; *    dialog.
  142. ; *      
  143.  
  144. ;
  145. ; extern TQ3Boolean Q3Renderer_HasModalConfigure(TQ3RendererObject renderer)
  146. ;
  147.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  148.         IMPORT_CFM_FUNCTION Q3Renderer_HasModalConfigure
  149.     ENDIF
  150.  
  151. ;
  152. ; extern TQ3Status Q3Renderer_ModalConfigure(TQ3RendererObject renderer, TQ3DialogAnchor dialogAnchor, TQ3Boolean *canceled)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION Q3Renderer_ModalConfigure
  156.     ENDIF
  157.  
  158. ; *    Q3RendererClass_GetNickNameString
  159. ; *        Allows an application to get a renderers name string, the 
  160. ; *        renderer is responsible for storing this in a localizable format
  161. ; *        for example as a resource.  This string can then be used to provide
  162. ; *        a selection mechanism for an application (for example in a menu).
  163. ; *
  164. ; *        If this call returns nil in the supplied string, then the App may 
  165. ; *         choose to use the class name for the renderer.  You should always 
  166. ; *        try to get the name string before using the class name, since the
  167. ; *        class name is not localizable.
  168.  
  169. ;
  170. ; extern TQ3Status Q3RendererClass_GetNickNameString(TQ3ObjectType rendererClassType, TQ3ObjectClassNameString rendererClassString)
  171. ;
  172.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION Q3RendererClass_GetNickNameString
  174.     ENDIF
  175.  
  176.  
  177. ; *    Q3Renderer_GetConfigurationData
  178. ; *        Allows an application to collect private renderer configuration data
  179. ; *      which it will then save. For example in a preference file or in a 
  180. ; *        style template. An application should tag this data with the 
  181. ; *        Renderer's object  name.
  182. ; *    
  183. ; *        if dataBuffer is NULL actualDataSize returns the required size in 
  184. ; *        bytes of a data buffer large enough to store private data. 
  185. ; *
  186. ; *      bufferSize is the actual size of the memory block pointed to by 
  187. ; *        dataBuffer
  188. ; *
  189. ; *        actualDataSize - on return the actual number of bytes written to the 
  190. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  191. ; * 
  192.  
  193. ;
  194. ; extern TQ3Status Q3Renderer_GetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize, unsigned long *actualDataSize)
  195. ;
  196.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  197.         IMPORT_CFM_FUNCTION Q3Renderer_GetConfigurationData
  198.     ENDIF
  199.  
  200. ;
  201. ; extern TQ3Status Q3Renderer_SetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize)
  202. ;
  203.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  204.         IMPORT_CFM_FUNCTION Q3Renderer_SetConfigurationData
  205.     ENDIF
  206.  
  207.  
  208.  
  209. ; ******************************************************************************
  210. ; **                                                                             **
  211. ; **                        Interactive Renderer Specific Functions                 **
  212. ; **                                                                             **
  213. ; ****************************************************************************
  214.  
  215. ;  CSG IDs attribute 
  216. ;  Object IDs, to be applied as attributes on geometries 
  217. ;  Possible CSG equations 
  218.  
  219. ; typedef long                            TQ3CSGEquation
  220. kQ3CSGEquationAandB                EQU        $88888888
  221. kQ3CSGEquationAandnotB            EQU        $22222222
  222. kQ3CSGEquationAanBonCad            EQU        $2F222F22
  223. kQ3CSGEquationnotAandB            EQU        $44444444
  224. kQ3CSGEquationnAaBorCanB        EQU        $74747474
  225.  
  226. ; typedef long                            TQ3HiddenSurfaceRemovalMode
  227. kQ3HiddenSurfaceRemovalMode_None EQU    0
  228. kQ3HiddenSurfaceRemovalMode_Shallow EQU    1
  229. kQ3HiddenSurfaceRemovalMode_Deep EQU    2
  230. ;
  231. ; extern TQ3Status Q3InteractiveRenderer_SetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation equation)
  232. ;
  233.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  234.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetCSGEquation
  235.     ENDIF
  236.  
  237. ;
  238. ; extern TQ3Status Q3InteractiveRenderer_GetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation *equation)
  239. ;
  240.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  241.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetCSGEquation
  242.     ENDIF
  243.  
  244. ;
  245. ; extern TQ3Status Q3InteractiveRenderer_SetPreferences(TQ3RendererObject renderer, long vendorID, long engineID)
  246. ;
  247.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  248.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetPreferences
  249.     ENDIF
  250.  
  251. ;
  252. ; extern TQ3Status Q3InteractiveRenderer_GetPreferences(TQ3RendererObject renderer, long *vendorID, long *engineID)
  253. ;
  254.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  255.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetPreferences
  256.     ENDIF
  257.  
  258. ;
  259. ; extern TQ3Status Q3InteractiveRenderer_SetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean bypass)
  260. ;
  261.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  262.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass
  263.     ENDIF
  264.  
  265. ;
  266. ; extern TQ3Status Q3InteractiveRenderer_GetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean *bypass)
  267. ;
  268.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  269.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass
  270.     ENDIF
  271.  
  272. ;
  273. ; extern TQ3Status Q3InteractiveRenderer_SetRAVEContextHints(TQ3RendererObject renderer, unsigned long RAVEContextHints)
  274. ;
  275.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVEContextHints
  277.     ENDIF
  278.  
  279. ;
  280. ; extern TQ3Status Q3InteractiveRenderer_GetRAVEContextHints(TQ3RendererObject renderer, unsigned long *RAVEContextHints)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  283.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVEContextHints
  284.     ENDIF
  285.  
  286. ;
  287. ; extern TQ3Status Q3InteractiveRenderer_SetRAVETextureFilter(TQ3RendererObject renderer, unsigned long RAVEtextureFilterValue)
  288. ;
  289.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter
  291.     ENDIF
  292.  
  293. ;
  294. ; extern TQ3Status Q3InteractiveRenderer_GetRAVETextureFilter(TQ3RendererObject renderer, unsigned long *RAVEtextureFilterValue)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter
  298.     ENDIF
  299.  
  300.  
  301. ; ******************************************************************************
  302. ; **                                                                             **
  303. ; **                            Renderer View Tools                                 **
  304. ; **                                                                             **
  305. ; **                    You may only call these methods from a plug-in             **
  306. ; **                                                                             **
  307. ; ****************************************************************************
  308.  
  309. ; *    Call by a renderer to call the user "idle" method, with progress 
  310. ; *    information.
  311. ; *    
  312. ; *    Pass in (view, 0, n) on first call
  313. ; *    Pass in (view, 1..n-1, n) during rendering
  314. ; *    Pass in (view, n, n) upon completion
  315. ; *    
  316. ; *    Note: The user must have supplied an idleProgress method with 
  317. ; *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  318. ; *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  319. ; *    is called instead. (current and final are ignored, essentially.)
  320. ; *
  321. ; *    Returns kQ3Failure if rendering is cancelled.
  322.  
  323. ;
  324. ; extern TQ3Status Q3XView_IdleProgress(TQ3ViewObject view, unsigned long current, unsigned long completed)
  325. ;
  326.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION Q3XView_IdleProgress
  328.     ENDIF
  329.  
  330. ; *    Called by an asynchronous renderer when it completes a frame.
  331.  
  332. ;
  333. ; extern TQ3Status Q3XView_EndFrame(TQ3ViewObject view)
  334. ;
  335.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  336.         IMPORT_CFM_FUNCTION Q3XView_EndFrame
  337.     ENDIF
  338.  
  339.  
  340. ; ******************************************************************************
  341. ; **                                                                             **
  342. ; **                            Renderer AttributeSet Tools                         **
  343. ; **                                                                             **
  344. ; **                    You may only call these methods from a plug-in             **
  345. ; **                                                                             **
  346. ; ****************************************************************************
  347.  
  348. ; *    Faster access to geometry attribute sets.
  349. ; *    
  350. ; *    Returns pointer to INTERNAL data structure for elements and attributes
  351. ; *    in an attributeSet, or NULL if no attribute exists.
  352. ; *    
  353. ; *    For attributes of type kQ3AttributeType..., the internal data structure
  354. ; *    is identical to the data structure used in Q3AttributeSet_Add.
  355.  
  356. ;
  357. ; extern void *Q3XAttributeSet_GetPointer(TQ3AttributeSet attributeSet, TQ3AttributeType attributeType)
  358. ;
  359.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  360.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetPointer
  361.     ENDIF
  362.  
  363.  
  364.  
  365. kQ3XAttributeMaskNone            EQU        0
  366. kQ3XAttributeMaskSurfaceUV        EQU        $01
  367. kQ3XAttributeMaskShadingUV        EQU        $02
  368. kQ3XAttributeMaskNormal            EQU        $04
  369. kQ3XAttributeMaskAmbientCoefficient EQU    $08
  370. kQ3XAttributeMaskDiffuseColor    EQU        $10
  371. kQ3XAttributeMaskSpecularColor    EQU        $20
  372. kQ3XAttributeMaskSpecularControl EQU    $40
  373. kQ3XAttributeMaskTransparencyColor EQU    $80
  374. kQ3XAttributeMaskSurfaceTangent    EQU        $0100
  375. kQ3XAttributeMaskHighlightState    EQU        $0200
  376. kQ3XAttributeMaskSurfaceShader    EQU        $0400
  377. kQ3XAttributeMaskCustomAttribute EQU    $80000000
  378. kQ3XAttributeMaskAll            EQU        $800007FF
  379. kQ3XAttributeMaskInherited        EQU        $03FF
  380. kQ3XAttributeMaskInterpolated    EQU        $01FF
  381. ; typedef unsigned long                 TQ3XAttributeMask
  382.  
  383. ;
  384. ; extern TQ3XAttributeMask Q3XAttributeSet_GetMask(TQ3AttributeSet attributeSet)
  385. ;
  386.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetMask
  388.     ENDIF
  389.  
  390.  
  391. ; ******************************************************************************
  392. ; **                                                                             **
  393. ; **                            Renderer Draw Context Tools                         **
  394. ; **                                                                             **
  395. ; ****************************************************************************
  396.  
  397.  
  398.  
  399. ;
  400. ; extern TQ3Status Q3XDrawContext_GetDrawRegion(TQ3DrawContextObject drawContext, TQ3XDrawRegion *drawRegion)
  401. ;
  402.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  403.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetDrawRegion
  404.     ENDIF
  405.  
  406.  
  407. ; typedef long                            TQ3XDrawContextValidationMasks
  408. kQ3XDrawContextValidationClearFlags EQU    $00000000
  409. kQ3XDrawContextValidationDoubleBuffer EQU $01
  410. kQ3XDrawContextValidationShader    EQU        $02
  411. kQ3XDrawContextValidationClearFunction EQU $04
  412. kQ3XDrawContextValidationActiveBuffer EQU $08
  413. kQ3XDrawContextValidationInternalOffScreen EQU $10
  414. kQ3XDrawContextValidationPane    EQU        $20
  415. kQ3XDrawContextValidationMask    EQU        $40
  416. kQ3XDrawContextValidationDevice    EQU        $80
  417. kQ3XDrawContextValidationWindow    EQU        $0100
  418. kQ3XDrawContextValidationWindowSize EQU    $0200
  419. kQ3XDrawContextValidationWindowClip EQU    $0400
  420. kQ3XDrawContextValidationWindowPosition EQU $0800
  421. kQ3XDrawContextValidationPlatformAttributes EQU $1000
  422. kQ3XDrawContextValidationForegroundShader EQU $2000
  423. kQ3XDrawContextValidationBackgroundShader EQU $4000
  424. kQ3XDrawContextValidationColorPalette EQU $8000
  425. kQ3XDrawContextValidationAll    EQU        $FFFFFFFF
  426. ; typedef unsigned long                 TQ3XDrawContextValidation
  427.  
  428. ;
  429. ; extern TQ3Status Q3XDrawContext_ClearValidationFlags(TQ3DrawContextObject drawContext)
  430. ;
  431.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  432.         IMPORT_CFM_FUNCTION Q3XDrawContext_ClearValidationFlags
  433.     ENDIF
  434.  
  435. ;
  436. ; extern TQ3Status Q3XDrawContext_GetValidationFlags(TQ3DrawContextObject drawContext, TQ3XDrawContextValidation *validationFlags)
  437. ;
  438.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  439.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetValidationFlags
  440.     ENDIF
  441.  
  442.  
  443. ; ******************************************************************************
  444. ; **                                                                             **
  445. ; **                            Renderer Draw Region Tools                         **
  446. ; **                                                                             **
  447. ; ****************************************************************************
  448.  
  449.  
  450. ; typedef long                            TQ3XDevicePixelType
  451.                                                             ; These do not indicate byte ordering   
  452. kQ3XDevicePixelTypeInvalid        EQU        0                    ; Unknown, un-initialized type     
  453. kQ3XDevicePixelTypeRGB32        EQU        1                    ; Alpha:8 (ignored), R:8, G:8, B:8 
  454. kQ3XDevicePixelTypeARGB32        EQU        2                    ; Alpha:8, R:8, G:8, B:8              
  455. kQ3XDevicePixelTypeRGB24        EQU        3                    ; 24 bits/pixel, R:8, G:8, B:8     
  456. kQ3XDevicePixelTypeRGB16        EQU        4                    ; Alpha:1 (ignored), R:5, G:5, B:5 
  457. kQ3XDevicePixelTypeARGB16        EQU        5                    ; Alpha:1, R:5, G:5, B:5              
  458. kQ3XDevicePixelTypeRGB16_565    EQU        6                    ; 16 bits/pixel, R:5, G:6, B:5     
  459. kQ3XDevicePixelTypeIndexed8        EQU        7                    ; 8-bit color table index             
  460. kQ3XDevicePixelTypeIndexed4        EQU        8                    ; 4-bit color table index             
  461. kQ3XDevicePixelTypeIndexed2        EQU        9                    ; 2-bit color table index             
  462. kQ3XDevicePixelTypeIndexed1        EQU        10                    ; 1-bit color table index             
  463.  
  464. ; typedef long                            TQ3XClipMaskState
  465. kQ3XClipMaskFullyExposed        EQU        0
  466. kQ3XClipMaskPartiallyExposed    EQU        1
  467. kQ3XClipMaskNotExposed            EQU        2
  468. TQ3XColorDescriptor        RECORD 0
  469. redShift                 ds.l    1                ; offset: $0 (0)
  470. redMask                     ds.l    1                ; offset: $4 (4)
  471. greenShift                 ds.l    1                ; offset: $8 (8)
  472. greenMask                 ds.l    1                ; offset: $C (12)
  473. blueShift                 ds.l    1                ; offset: $10 (16)
  474. blueMask                 ds.l    1                ; offset: $14 (20)
  475. alphaShift                 ds.l    1                ; offset: $18 (24)
  476. alphaMask                 ds.l    1                ; offset: $1C (28)
  477. sizeof                     EQU *                    ; size:   $20 (32)
  478.                         ENDR
  479. TQ3XDrawRegionDescriptor RECORD 0
  480. width                     ds.l    1                ; offset: $0 (0)
  481. height                     ds.l    1                ; offset: $4 (4)
  482. rowBytes                 ds.l    1                ; offset: $8 (8)
  483. pixelSize                 ds.l    1                ; offset: $C (12)
  484. pixelType                 ds.l    1                ; offset: $10 (16)
  485. colorDescriptor             ds        TQ3XColorDescriptor ; offset: $14 (20)
  486. bitOrder                 ds.l    1                ; offset: $34 (52)
  487. byteOrder                 ds.l    1                ; offset: $38 (56)
  488. clipMask                 ds.l    1                ; offset: $3C (60)
  489. sizeof                     EQU *                    ; size:   $40 (64)
  490.                         ENDR
  491.  
  492. ; typedef long                            TQ3XDrawRegionServicesMasks
  493. kQ3XDrawRegionServicesNoneFlag    EQU        0
  494. kQ3XDrawRegionServicesClearFlag    EQU        $01
  495. kQ3XDrawRegionServicesDontLockDDSurfaceFlag EQU $02
  496. ; typedef unsigned long                 TQ3XDrawRegionServices
  497.  
  498. ;
  499. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleX(TQ3XDrawRegion drawRegion, float *deviceScaleX)
  500. ;
  501.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  502.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleX
  503.     ENDIF
  504.  
  505. ;
  506. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleY(TQ3XDrawRegion drawRegion, float *deviceScaleY)
  507. ;
  508.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  509.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleY
  510.     ENDIF
  511.  
  512.  
  513. ;
  514. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetX(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  517.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetX
  518.     ENDIF
  519.  
  520. ;
  521. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetY(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  522. ;
  523.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  524.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetY
  525.     ENDIF
  526.  
  527.  
  528. ;
  529. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleX(TQ3XDrawRegion drawRegion, float *windowScaleX)
  530. ;
  531.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  532.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleX
  533.     ENDIF
  534.  
  535. ;
  536. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleY(TQ3XDrawRegion drawRegion, float *windowScaleY)
  537. ;
  538.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  539.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleY
  540.     ENDIF
  541.  
  542.  
  543. ;
  544. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetX(TQ3XDrawRegion drawRegion, float *windowOffsetX)
  545. ;
  546.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  547.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetX
  548.     ENDIF
  549.  
  550. ;
  551. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetY(TQ3XDrawRegion drawRegion, float *windowOffsetY)
  552. ;
  553.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  554.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetY
  555.     ENDIF
  556.  
  557. ;
  558. ; extern TQ3Status Q3XDrawRegion_IsActive(TQ3XDrawRegion drawRegion, TQ3Boolean *isActive)
  559. ;
  560.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  561.         IMPORT_CFM_FUNCTION Q3XDrawRegion_IsActive
  562.     ENDIF
  563.  
  564.  
  565. ;
  566. ; extern TQ3Status Q3XDrawRegion_GetNextRegion(TQ3XDrawRegion drawRegion, TQ3XDrawRegion *nextDrawRegion)
  567. ;
  568.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  569.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetNextRegion
  570.     ENDIF
  571.  
  572. ;  
  573. ; *  One of the next two functions must be called before using a draw region 
  574.  
  575. ; *    Use this Start function if double buffering/image access services from the
  576. ; *    Draw Context are not needed, you may still request clear for example
  577.  
  578. ;
  579. ; extern TQ3Status Q3XDrawRegion_Start(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor)
  580. ;
  581.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  582.         IMPORT_CFM_FUNCTION Q3XDrawRegion_Start
  583.     ENDIF
  584.  
  585. ; *    Use this Start function if double buffering or image access services from 
  586. ; *  the Draw Context are needed.
  587.  
  588. ;
  589. ; extern TQ3Status Q3XDrawRegion_StartAccessToImageBuffer(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor, void **image)
  590. ;
  591.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  592.         IMPORT_CFM_FUNCTION Q3XDrawRegion_StartAccessToImageBuffer
  593.     ENDIF
  594.  
  595. ; *    This function is used to indicate that access to a DrawRegion is ended.
  596.  
  597. ;
  598. ; extern TQ3Status Q3XDrawRegion_End(TQ3XDrawRegion drawRegion)
  599. ;
  600.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  601.         IMPORT_CFM_FUNCTION Q3XDrawRegion_End
  602.     ENDIF
  603.  
  604. ;
  605. ; extern TQ3Status Q3XDrawRegion_GetDeviceTransform(TQ3XDrawRegion drawRegion, TQ3Matrix4x4 **deviceTransform)
  606. ;
  607.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  608.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceTransform
  609.     ENDIF
  610.  
  611. ;
  612. ; extern TQ3Status Q3XDrawRegion_GetClipFlags(TQ3XDrawRegion drawRegion, TQ3XClipMaskState *clipMaskState)
  613. ;
  614.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  615.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipFlags
  616.     ENDIF
  617.  
  618. ;
  619. ; extern TQ3Status Q3XDrawRegion_GetClipMask(TQ3XDrawRegion drawRegion, TQ3Bitmap **clipMask)
  620. ;
  621.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  622.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipMask
  623.     ENDIF
  624.  
  625.     IF TARGET_OS_MAC THEN
  626. ;
  627. ; extern TQ3Status Q3XDrawRegion_GetClipRegion(TQ3XDrawRegion drawRegion, RgnHandle *rgnHandle)
  628. ;
  629.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  630.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipRegion
  631.     ENDIF
  632.  
  633. ;
  634. ; extern TQ3Status Q3XDrawRegion_GetGDHandle(TQ3XDrawRegion drawRegion, GDHandle *gdHandle)
  635. ;
  636.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  637.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetGDHandle
  638.     ENDIF
  639.  
  640.     ENDIF    ; TARGET_OS_MAC
  641. ;
  642. ; extern TQ3Status Q3XDrawRegion_GetRendererPrivate(TQ3XDrawRegion drawRegion, void **rendererPrivate)
  643. ;
  644.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  645.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetRendererPrivate
  646.     ENDIF
  647.  
  648. ;
  649. ; extern TQ3Status Q3XDrawRegion_SetRendererPrivate(TQ3XDrawRegion drawRegion, const void *rendererPrivate, TQ3XDrawRegionRendererPrivateDeleteMethod deleteMethod)
  650. ;
  651.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  652.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetRendererPrivate
  653.     ENDIF
  654.  
  655. ;
  656. ; extern TQ3Status Q3XDrawRegion_SetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean flag)
  657. ;
  658.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  659.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag
  660.     ENDIF
  661.  
  662. ;
  663. ; extern TQ3Status Q3XDrawRegion_GetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean *useDefaultRenderingFlag)
  664. ;
  665.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  666.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag
  667.     ENDIF
  668.  
  669.  
  670.  
  671. ; ******************************************************************************
  672. ; **                                                                             **
  673. ; **                            Renderer Class Methods                             **
  674. ; **                                                                             **
  675. ; ****************************************************************************
  676.  
  677. ; *    Methods from Object
  678. ; *        kQ3XMethodTypeObjectClassRegister
  679. ; *        kQ3XMethodTypeObjectClassUnregister
  680. ; *        kQ3XMethodTypeObjectNew
  681. ; *        kQ3XMethodTypeObjectDelete
  682. ; *        kQ3XMethodTypeObjectRead
  683. ; *        kQ3XMethodTypeObjectTraverse
  684. ; *        kQ3XMethodTypeObjectWrite
  685. ; *        
  686. ; *    Methods from Shared
  687. ; *        kQ3MethodTypeSharedEdited
  688. ; *
  689. ; *    Renderer Methods
  690. ; *    
  691. ; *    The renderer methods should be implemented according to the type
  692. ; *    of renderer being written.
  693. ; *
  694. ; *    For the purposes of documentation, there are two basic types of
  695. ; *    renderers: 
  696. ; *
  697. ; *        Interactive
  698. ; *            Interactive Renderer
  699. ; *            WireFrame Renderer
  700. ; *        
  701. ; *        Deferred
  702. ; *            a ray-tracer
  703. ; *            painter's algorithm renderer (cached in a BSP triangle tree)
  704. ; *            an artistic renderer (simulates a pencil drawing, etc.)
  705. ; *
  706. ; *    The main difference is how each renderer handles incoming state and 
  707. ; *    geometry.
  708. ; *
  709. ; *    An interactive renderer immediately transforms, culls, and shades
  710. ; *    incoming geometry and performs rasterization. For example, in a 
  711. ; *    single-buffered WireFrame renderer, you will see a new triangle
  712. ; *    immediately after Q3Triangle_Draw (if it's visible, of course).
  713. ; *
  714. ; *    A deferred renderer caches the view state and each geometry, 
  715. ; *    converting into any internal queue of drawing commands. Rasterization
  716. ; *    is not actually performed until all data has been submitted.
  717. ; *    
  718. ; *    For example, a ray-tracer may not rasterize anything until the
  719. ; *    end of the rendering loop, or until an EndFrame call is made.
  720.  
  721.  
  722. ; ******************************************************************************
  723. ; **                                                                             **
  724. ; **                        Renderer User Interface Methods                         **
  725. ; **                                                                             **
  726. ; ****************************************************************************
  727.  
  728. ; *    kQ3XMethodTypeRendererIsInteractive
  729. ; *    
  730. ; *    There is no actual method with this - the metahandler simply returns
  731. ; *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  732. ; *  intended to be used in interactive settings, and   
  733. ; *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  734. ; *  
  735. ; *  If neither value is specified in the metahandler, the renderer 
  736. ; *  is *assumed to be non-interactive*!!!
  737. ; *    
  738. ; *    OPTIONAL
  739.  
  740.  
  741. kQ3XMethodTypeRendererIsInteractive EQU    'isin'
  742.  
  743. ; *    TQ3XRendererModalConfigureMethod
  744. ; *    
  745. ; *    This method should pop up a modal dialog to edit the renderer settings 
  746. ; *    found in the renderer private. 
  747. ; *    
  748. ; *    dialogAnchor - is platform specific data passed by the client to support
  749. ; *      movable modal dialogs. 
  750. ; *    MacOS: this is a callback to the calling application's event handler.
  751. ; *      The renderer calls this function with events not handled by the 
  752. ; *      settings dialog. This is necessary in order to support movable modal 
  753. ; *      dialogs. An application's event handler must return kQ3True if it 
  754. ; *      handles the event passed to the callback or kQ3False if not. 
  755. ; *      An application which doesn't want to support a movable modal configure
  756. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  757. ; *      A renderer should implement a non-movable style dialog in that case.
  758. ; *    Win32: this is the HWND of the owning window (typically an application's
  759. ; *      main window).  (Win32 application modal dialogs are always movable.)
  760. ; *  canceled - returns a boolean inditacating that the user canceled the 
  761. ; *    dialog.
  762. ; *    
  763. ; *    OPTIONAL
  764.  
  765.  
  766. kQ3XMethodTypeRendererModalConfigure EQU 'rdmc'
  767. ; *    kQ3XMethodTypeRendererGetNickNameString
  768. ; *    
  769. ; *        Allows an application to collect the name of the renderer for
  770. ; *        display in a user interface item such as a menu.
  771. ; *    
  772. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  773. ; *        bytes of a data buffer large enough to store the renderer name. 
  774. ; *
  775. ; *      bufferSize is the actual size of the memory block pointed to by 
  776. ; *        dataBuffer
  777. ; *
  778. ; *        actualDataSize - on return the actual number of bytes written to the
  779. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  780. ; *
  781. ; *    OPTIONAL
  782.  
  783.  
  784. kQ3XMethodTypeRendererGetNickNameString EQU 'rdns'
  785. ; *    kQ3XMethodTypeRendererGetConfigurationData
  786. ; *    
  787. ; *        Allows an application to collect private configuration data from the
  788. ; *      renderer which it will then save. For example in a preference file, 
  789. ; *      a registry key (on Windows) or in a style template. An application 
  790. ; *      should tag this data with the renderer's object name.
  791. ; *    
  792. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  793. ; *        bytes of a data buffer large enough to store private data. 
  794. ; *
  795. ; *      bufferSize is the actual size of the memory block pointed to by 
  796. ; *        dataBuffer
  797. ; *
  798. ; *        actualDataSize - on return the actual number of bytes written to the
  799. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  800. ; *
  801. ; *    OPTIONAL
  802.  
  803.  
  804. kQ3XMethodTypeRendererGetConfigurationData EQU 'rdgp'
  805. ; *    TQ3XRendererSetConfigurationDataMethod
  806. ; *    
  807. ; *        Allows an application to pass private configuration data which has
  808. ; *         previously  been obtained from a renderer via 
  809. ; *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  810. ; *        in a style template. An application should tag this data with the 
  811. ; *        renderer's object name.
  812. ; *    
  813. ; *      bufferSize is the actual size of the memory block pointed to by 
  814. ; *        dataBuffer
  815. ; *
  816. ; *    OPTIONAL
  817.  
  818.  
  819. kQ3XMethodTypeRendererSetConfigurationData EQU 'rdsp'
  820. ; ******************************************************************************
  821. ; **                                                                             **
  822. ; **                        Renderer Drawing State Methods                         **
  823. ; **                                                                             **
  824. ; ****************************************************************************
  825.  
  826. ; *    TQ3RendererStartFrame
  827. ; *    
  828. ; *    The StartFrame method is called first at Q3View_StartRendering
  829. ; *    and should:
  830. ; *        - initialize any renderer state to defaults
  831. ; *        - extract any and all useful data from the drawContext
  832. ; *
  833. ; *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  834. ; *    registration, then it should also:
  835. ; *        - clear the drawContext 
  836. ; *    
  837. ; *        When clearing, your renderer may opt to:
  838. ; *        - NOT clear anything (if you touch every pixel, for example)
  839. ; *        - to clear with your own routine, or
  840. ; *        - to use the draw context default clear method by calling 
  841. ; *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  842. ; *        any available hardware in the system for clearing.
  843. ; *    
  844. ; *    This call also signals the start of all default submit commands from
  845. ; *    the view. The renderer will receive updates for the default view
  846. ; *    state via its Update methods before StartPass is called.
  847. ; *    
  848. ; *    REQUIRED
  849.  
  850.  
  851. kQ3XMethodTypeRendererStartFrame EQU    'rdcl'
  852. ; *    kQ3XMethodTypeRendererStartPass
  853. ; *    TQ3XRendererStartPassMethod
  854. ; *    
  855. ; *    The StartPass method is called during Q3View_StartRendering but after
  856. ; *    the StartFrame command. It should:
  857. ; *        - collect camera and light information
  858. ; *    
  859. ; *    If your renderer supports deferred camera transformation, camera is the
  860. ; *    main camera which will be submitted in the hierarchy somewhere. It
  861. ; *    is never NULL.
  862. ; *
  863. ; *    If your renderer does not support deferred camera transformation, camera
  864. ; *    is the transformed camera.
  865. ; *
  866. ; *    If your renderer supports deferred light transformation, lights will be
  867. ; *    NULL, and will be submitted to your light draw methods instead.
  868. ; *
  869. ; *    This call signals the end of the default update state, and the start of 
  870. ; *  submit commands from the user to the view.
  871. ; *
  872. ; *    REQUIRED
  873.  
  874.  
  875. kQ3XMethodTypeRendererStartPass    EQU        'rdst'
  876. ; *    kQ3XMethodTypeRendererFlushFrame
  877. ; *    TQ3XRendererFlushFrameMethod
  878. ; *    
  879. ; *    This call is only implemented by asynchronous renderers.
  880. ; *    
  881. ; *    The FlushFrame method is called between the StartPass and EndPass
  882. ; *    methods and is called when the user wishes to flush any asynchronous
  883. ; *    drawing tasks (which draw to the drawcontext), but does not want 
  884. ; *    to block.
  885. ; *    
  886. ; *    The result of this call is that an image should "eventually" appear
  887. ; *    asynchronously.
  888. ; *    
  889. ; *    For asynchronous rendering, this call is non-blocking.
  890. ; *    
  891. ; *    An interactive renderer should ensure that all received
  892. ; *    geometries are drawn in the image.
  893. ; *    
  894. ; *    An interactive renderer that talks to hardware should force
  895. ; *    the hardware to generate an image.
  896. ; *    
  897. ; *    A deferred renderer should exhibit a similar behaviour,
  898. ; *    though it is not required.  A deferred renderer should spawn
  899. ; *    a process that generates a partial image from the currently
  900. ; *    accumulated drawing state. 
  901. ; *    
  902. ; *    However, for renderers such as ray-tracers which generally are
  903. ; *    quite compute-intensive, FlushFrame is not required and is a no-op.
  904. ; *
  905. ; *    OPTIONAL
  906.  
  907.  
  908. kQ3XMethodTypeRendererFlushFrame EQU    'rdfl'
  909. ; *    kQ3XMethodTypeRendererEndPass
  910. ; *    TQ3XRendererEndPassMethod
  911. ; *    
  912. ; *    The EndPass method is called at Q3View_EndRendering and signals
  913. ; *    the end of submit commands to the view.
  914. ; *
  915. ; *    If an error occurs, the renderer should call Q3XError_Post and
  916. ; *    return kQ3ViewStatusError.
  917. ; *    
  918. ; *    If a renderer requires another pass on the renderering data,
  919. ; *    it should return kQ3ViewStatusRetraverse.
  920. ; *    
  921. ; *    If rendering was cancelled, this function will not be called
  922. ; *    and the view will handle returning kQ3ViewStatusCancelled;
  923. ; *    
  924. ; *    Otherwise, your renderer should begin completing the process of 
  925. ; *    generating the image in the drawcontext. If you have buffered
  926. ; *    any drawing data, flush it. RendererEnd should have a similar
  927. ; *    effect as RendererFlushFrame.
  928. ; *    
  929. ; *    If the renderer is synchronous:
  930. ; *        - complete rendering of the entire frame
  931. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  932. ; *            - Update the front buffer
  933. ; *        else
  934. ; *            - DrawContext will update the front buffer after returning
  935. ; *
  936. ; *    If the renderer is asynchronous
  937. ; *        - spawn rendering thread for entire frame
  938. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  939. ; *            - you must eventually update the front buffer asynchronously
  940. ; *        else
  941. ; *            - you must eventually update the back buffer asynchronously
  942. ; *            
  943. ; *    REQUIRED
  944.  
  945.  
  946. kQ3XMethodTypeRendererEndPass    EQU        'rded'
  947. ; *    kQ3XMethodTypeRendererEndFrame
  948. ; *    TQ3XRendererEndFrame
  949. ; *    
  950. ; *    This call is only implemented by asynchronous renderers.
  951. ; *
  952. ; *    The EndFrame method is called from Q3View_Sync, which is
  953. ; *    called after Q3View_EndRendering and signals that the user
  954. ; *    wishes to see the completed image and is willing to block.
  955. ; *    
  956. ; *    If your renderer supports kQ3RendererFlagDoubleBuffer
  957. ; *        - update the front buffer completely 
  958. ; *    else
  959. ; *        - update the back buffer completely
  960. ; *
  961. ; *    This call is equivalent in functionality to RendererFlushFrame
  962. ; *    but blocks until the image is completed.
  963. ; *    
  964. ; *    If no method is supplied, the default is a no-op.
  965. ; *    
  966. ; *    NOTE: Registering a method of this type indicates that your renderer will
  967. ; *    be rendering after Q3View_EndRendering has been called.
  968. ; *    
  969. ; *    OPTIONAL
  970.  
  971.  
  972. kQ3XMethodTypeRendererEndFrame    EQU        'rdsy'
  973. ; *    The RendererCancel method is called after Q3View_StartRendering
  974. ; *    and signals the termination of all rendering operations.
  975. ; *
  976. ; *    A renderer should clean up any cached data, and cancel all 
  977. ; *    rendering operations.
  978. ; *    
  979. ; *    If called before Q3View_EndRendering, the RendererEnd method
  980. ; *    is NOT called.
  981. ; *    
  982. ; *    If called after Q3View_EndRendering, the renderer should kill
  983. ; *    any threads and terminate any further rendering.
  984. ; *    
  985. ; *    REQUIRED
  986.  
  987.  
  988. kQ3XMethodTypeRendererCancel    EQU        'rdab'
  989. ; ******************************************************************************
  990. ; **                                                                             **
  991. ; **                        Renderer DrawContext Methods                         **
  992. ; **                                                                             **
  993. ; ****************************************************************************
  994.  
  995. ; *    kQ3XMethodTypeRendererPush
  996. ; *    TQ3XRendererPushMethod
  997. ; *    
  998. ; *    kQ3XMethodTypeRendererPop
  999. ; *    TQ3XRendererPopMethod
  1000. ; *    
  1001. ; *    These methods are called whenever the graphics state in the view
  1002. ; *    is pushed or popped. The user may isolate state by calling:
  1003. ; *    
  1004. ; *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  1005. ; *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  1006. ; *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  1007. ; *    Q3Box_Submit(&unitBox, view);
  1008. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  1009. ; *    Q3Push_Submit(view);
  1010. ; *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  1011. ; *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  1012. ; *        Q3Box_Submit(&unitBox, view);
  1013. ; *    Q3Pop_Submit(view);    
  1014. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  1015. ; *    Q3Box_Submit(&unitBox, view);
  1016. ; *    
  1017. ; *    or by submitting a display group which pushes and pops.
  1018. ; *    
  1019. ; *    If you support RendererPush and RendererPop in your renderer:
  1020. ; *        - you must maintain your drawing state as a stack, as well.
  1021. ; *        - you will not be updated with the popped state after
  1022. ; *            RendererPop is called.
  1023. ; *
  1024. ; *    If you do not support Push and Pop in your renderer:
  1025. ; *        - you may maintain a single copy of the drawing state.
  1026. ; *        - you will be updated with changed fields after the view stack is
  1027. ; *            popped.
  1028. ; *
  1029. ; *    A renderer that supports Push and Pop gets called in the following
  1030. ; *    sequence (from example above):
  1031. ; *    
  1032. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1033. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1034. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1035. ; *    RendererUpdateMatrixLocalToWorld(...)
  1036. ; *    RendererSubmitGeometryBox(...)
  1037. ; *    RendererPush(...)
  1038. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1039. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1040. ; *        RendererSubmitGeometryBox(...)
  1041. ; *    RendererPop(...)
  1042. ; *    RendererUpdateMatrixLocalToWorld(...)
  1043. ; *    RendererSubmitGeometryBox(...)
  1044. ; *
  1045. ; *    A renderer that does not supports Push and Pop gets called in the
  1046. ; *    following sequence:
  1047. ; *    
  1048. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1049. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1050. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1051. ; *    RendererUpdateMatrixLocalToWorld(...)
  1052. ; *    RendererSubmitGeometryBox(...)
  1053. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1054. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1055. ; *        RendererSubmitGeometryBox(...)
  1056. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1057. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1058. ; *    RendererUpdateMatrixLocalToWorld(...)
  1059. ; *    RendererSubmitGeometryBox(...)
  1060. ; *    
  1061.  
  1062.  
  1063. kQ3XMethodTypeRendererPush        EQU        'rdps'
  1064.  
  1065. kQ3XMethodTypeRendererPop        EQU        'rdpo'
  1066. ; ******************************************************************************
  1067. ; **                                                                             **
  1068. ; **                            Renderer Cull Methods                             **
  1069. ; **                                                                             **
  1070. ; ****************************************************************************
  1071.  
  1072. ; *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  1073. ; *    TQ3XRendererIsBoundingBoxVisibleMethod
  1074. ; *    
  1075. ; *    This method is called to cull complex groups and geometries 
  1076. ; *    given their bounding box in local space.
  1077. ; *    
  1078. ; *    It should transform the local-space bounding box coordinates to
  1079. ; *    frustum space and return a TQ3Boolean return value indicating
  1080. ; *    whether the box appears within the viewing frustum.
  1081. ; *    
  1082. ; *    If no method is supplied, the default behavior is to return
  1083. ; *    kQ3True.
  1084. ; *    
  1085.  
  1086.  
  1087. kQ3XMethodTypeRendererIsBoundingBoxVisible EQU 'rdbx'
  1088.  
  1089. ; ******************************************************************************
  1090. ; **                                                                             **
  1091. ; **                        Renderer Object Support Methods                         **
  1092. ; **                                                                             **
  1093. ; ****************************************************************************
  1094.  
  1095. ; *    Drawing methods (Geometry, Camera, Lights)
  1096. ; *
  1097.  
  1098. ; *    Geometry MetaHandler
  1099. ; *    
  1100. ; *    This metaHandler is required to support 
  1101. ; *    
  1102. ; *    kQ3GeometryTypeTriangle
  1103. ; *    kQ3GeometryTypeLine
  1104. ; *    kQ3GeometryTypePoint
  1105. ; *    kQ3GeometryTypeMarker
  1106. ; *    kQ3GeometryTypePixmapMarker
  1107. ; *    
  1108. ; *    REQUIRED
  1109.  
  1110.  
  1111. kQ3XMethodTypeRendererSubmitGeometryMetaHandler EQU 'rdgm'
  1112. ; *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1113. ; *    of kQ3GeometryTypeFoo and returns methods of type:
  1114.  
  1115. ; *    Camera MetaHandler
  1116. ; *    
  1117. ; *    This metaHandler, if supplied, indicates that your renderer
  1118. ; *    handles deferred transformation of the main camera within a scene.
  1119. ; *    
  1120. ; *    If not supplied, or an unsupported camera is used, the view will do
  1121. ; *    the transformation for the renderer and pass in a camera in the 
  1122. ; *    StartPass method.
  1123. ; *    
  1124. ; *    OPTIONAL
  1125.  
  1126.  
  1127. kQ3XMethodTypeRendererSubmitCameraMetaHandler EQU 'rdcm'
  1128. ; *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1129. ; *    of kQ3CameraTypeFoo and returns methods of type:
  1130.  
  1131. ; *    Light MetaHandler
  1132. ; *    
  1133. ; *    This metaHandler, if supplied, indicates that your renderer
  1134. ; *    handles deferred transformation of lights within a scene.
  1135. ; *    
  1136. ; *    If an unsupported light is encountered, it is ignored.
  1137. ; *
  1138. ; *    OPTIONAL
  1139.  
  1140.  
  1141. kQ3XMethodTypeRendererSubmitLightMetaHandler EQU 'rdlg'
  1142. ; *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1143. ; *    of kQ3LightTypeFoo and returns methods of type:
  1144.  
  1145. ; *
  1146. ; *    Update methods
  1147. ; *
  1148. ; *    They are called whenever the state has changed. If the renderer supports
  1149. ; *    the RendererPush and RendererPop methods, it must maintain its own state
  1150. ; *    stack. Updates are not called for changed data when the view stack is
  1151. ; *    popped.
  1152. ; *
  1153. ; *    See the comments for the RendererPush and RendererPop methods above
  1154. ; *    for an example of how data is updated.
  1155. ; *
  1156.  
  1157. ; *    Style
  1158.  
  1159.  
  1160. kQ3XMethodTypeRendererUpdateStyleMetaHandler EQU 'rdyu'
  1161. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1162. ; *    of kQ3StyleTypeFoo and returns methods of type:
  1163.  
  1164. ; *    Attributes
  1165.  
  1166.  
  1167. kQ3XMethodTypeRendererUpdateAttributeMetaHandler EQU 'rdau'
  1168. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1169. ; *    of kQ3AttributeTypeFoo and returns methods of type:
  1170.  
  1171. ; *    Shaders
  1172.  
  1173.  
  1174. kQ3XMethodTypeRendererUpdateShaderMetaHandler EQU 'rdsu'
  1175. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1176. ; *    of kQ3ShaderTypeFoo and returns methods of type:
  1177.  
  1178. ; *    Matrices
  1179.  
  1180.  
  1181. kQ3XMethodTypeRendererUpdateMatrixMetaHandler EQU 'rdxu'
  1182. ; typedef TQ3XMetaHandler                 TQ3XRendererUpdateMatrixMetaHandlerMethod
  1183.  
  1184. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1185. ; *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1186.  
  1187.  
  1188. kQ3XMethodTypeRendererUpdateMatrixLocalToWorld EQU 'ulwx'
  1189.  
  1190. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse EQU 'ulwi'
  1191.  
  1192. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose EQU 'ulwt'
  1193.  
  1194. kQ3XMethodTypeRendererUpdateMatrixLocalToCamera EQU 'ulcx'
  1195.  
  1196. kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum EQU 'ulfx'
  1197.  
  1198. kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum EQU 'uwfx'
  1199. ; *    and returns methods of type:
  1200.  
  1201.  
  1202.     ENDIF ; __QD3DRENDERER__ 
  1203.  
  1204.